Skip to content

feat(app): add vcr app remove command [APIAPEX-2823]#82

Merged
gorkarevilla merged 13 commits into
mainfrom
feat/APIAPEX-2823/vcr-app-delete
May 19, 2026
Merged

feat(app): add vcr app remove command [APIAPEX-2823]#82
gorkarevilla merged 13 commits into
mainfrom
feat/APIAPEX-2823/vcr-app-delete

Conversation

@gorkarevilla

@gorkarevilla gorkarevilla commented May 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds vcr app remove <applicationID> [--yes|-y] command to remove a Vonage application
  • Follows the same confirmation prompt pattern as vcr instance remove and vcr secret remove
  • Adds DeleteVonageApplication to DeploymentClient and DeploymentInterface

Changes

  • pkg/api/deployment.go — new DeleteVonageApplication method (idempotent DELETE, returns nil on 404)
  • pkg/cmdutil/factory.go — method added to DeploymentInterface
  • testutil/mocks/factory.go — regenerated via go generate
  • vcr/app/remove/remove.go — command implementation
  • vcr/app/remove/remove_test.go — 5 table-driven test cases
  • vcr/app/app.go — subcommand registered, help text and examples updated

Usage

# Remove with confirmation prompt
vcr app remove 12345678-1234-1234-1234-123456789abc

# Remove without prompt (CI/CD)
vcr app remove 12345678-1234-1234-1234-123456789abc --yes

# Using the short alias
vcr app rm 12345678-1234-1234-1234-123456789abc --yes

Testing

All 24 test packages pass (go test ./...).

Jira: APIAPEX-2823

Copilot AI review requested due to automatic review settings May 18, 2026 07:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new vcr app delete <applicationID> [--yes|-y] subcommand that deletes a Vonage application through a new DeleteVonageApplication method on the deployment API client. The command mirrors the confirmation-prompt pattern used by vcr instance remove and vcr secret remove, and ships with table-driven unit tests and a regenerated DeploymentInterface mock.

Changes:

  • New DeleteVonageApplication method on DeploymentClient/DeploymentInterface (DELETE /applications/{id}, returns nil on 404).
  • New vcr/app/delete/ package implementing NewCmdAppDelete with --yes flag, spinner, and survey-driven confirmation, plus tests.
  • Registered the subcommand in vcr/app/app.go, updated its help/examples, and regenerated testutil/mocks/factory.go (also reorders some existing Datastore mocks).

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pkg/api/deployment.go Adds DeleteVonageApplication HTTP DELETE method; treats 404 as success.
pkg/cmdutil/factory.go Extends DeploymentInterface with DeleteVonageApplication.
testutil/mocks/factory.go Regenerated mock for the new method; also reorders ListInstances/ListLogsByInstanceID.
vcr/app/delete/delete.go New command implementation with confirmation prompt and spinner.
vcr/app/delete/delete_test.go Table-driven tests for happy-path, prompt-abort, missing-arg, and API error.
vcr/app/app.go Registers the new subcommand and updates the help text and examples.
docs/superpowers/specs/2026-05-18-vcr-app-delete-design.md Design doc for the new command.
docs/superpowers/plans/2026-05-18-vcr-app-delete.md Step-by-step implementation plan.
Files not reviewed (1)
  • testutil/mocks/factory.go: Language not supported

Comment thread vcr/app/remove/remove_test.go Outdated
Comment thread pkg/api/deployment.go
Comment thread pkg/api/deployment.go
Comment thread pkg/api/deployment.go
Comment thread vcr/app/remove/remove_test.go Outdated
@gorkarevilla gorkarevilla force-pushed the feat/APIAPEX-2823/vcr-app-delete branch from a3e5b46 to aa6e115 Compare May 18, 2026 07:55
@gorkarevilla gorkarevilla changed the title feat(app): add vcr app delete command [APIAPEX-2823] feat(app): add vcr app remove command [APIAPEX-2823] May 18, 2026
- Return ErrNotFound on 404 in DeleteVonageApplication (was silently nil)
- Handle ErrNotFound in runRemove with descriptive user-facing error
- Use url.PathEscape for application ID in URL construction
- Add TestDeleteVonageApplication with 204/404/500 cases
- Fix err shadowing in remove_test.go (ExecuteC result was discarded)
- Only register mock expectations when Times > 0
@gorkarevilla gorkarevilla merged commit 4f861f4 into main May 19, 2026
9 checks passed
@gorkarevilla gorkarevilla deleted the feat/APIAPEX-2823/vcr-app-delete branch May 19, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants